﻿package com.mod.page  {
	
    import com.calefk.core.Page;
	import com.mod.Global;
    import com.mod.ModProject;
    import com.mod.PMGame;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
	
	public class WinPage extends Page {
		
		public function WinPage(canvas:MovieClip, nameClip:String = null,
				x:Number = 0, y:Number = 0) {
			super(canvas, nameClip, x, y);
			Global.stopAllSounds();
			clip.btnRetry.addEventListener(MouseEvent.CLICK , onRetry , false , 0 , true);
		}
		
		private function onRetry(e:MouseEvent):void {
			Global.currentLevel = 0;
			// go to page game
			ModProject.getPM().onTransition(200 , 200 , PMGame.PAGE_MENU , null , null, 0x000000 , Global.SW , Global.SH);
		}
		
		override public function clean():void {
			clip.btnRetry.removeEventListener(MouseEvent.CLICK , onRetry);
			super.clean();
		}
	}

}